package app

import x "gitcode.com/shexk/xframe/plugin"

func PostMsgToPlugin(name string, task []byte) {
	v := x.Object{Type: x.Type_Plugin, Name: name}
	ss := x.PluginMsg{ID: x.GetMessageID(), Cmd: x.Command_TransPlugin,
		Sender:   x.Object{Type: x.Type_Service, Name: "CommandCenter"},
		Receiver: []x.Object{v},
		Data:     task}
	GetApp().appobj.DataBus <- &ss
}

func PostMsgToTopic(name string, task []byte) {
	v := x.Object{Type: x.Command_RegTopic, Name: name}
	ss := x.PluginMsg{ID: x.GetMessageID(), Cmd: x.Command_TransPlugin,
		Sender:   x.Object{Type: x.Type_Service, Name: "CommandCenter"},
		Receiver: []x.Object{v},
		Data:     task}
	GetApp().appobj.DataBus <- &ss
}
